package com.ruoyi.wjq.domain;

import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.fk.domain.Question;
import com.ruoyi.fk.domain.QuestionBank;
import com.ruoyi.youyou.domain.SysYouYouUser;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.fk.domain.QuestionBank;

import java.beans.Transient;
import java.util.List;

/**
 * 答题记录对象 answer_record
 * 
 * @author wjq
 * @date 2025-08-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AnswerRecord extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 记录ID */
    private Long id;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** 题库ID */
    @Excel(name = "题库ID")
    private Long bankId;

    /** 总题数 */
    @Excel(name = "总题数")
    private Long totalCount;

    /** 答对题目ID列表 */
    @Excel(name = "答对题目ID列表")
    private String correctList;

    /** 答错题目ID列表 */
    @Excel(name = "答错题目ID列表")
    private String wrongList;

    /** 未答题目ID列表 */
    @Excel(name = "未答题目ID列表")
    private String unansweredList;

    /** 记录类型 */
    @Excel(name = "记录类型")
    private String recordType;

    /** 耗时（秒） */
    @Excel(name = "耗时", readConverterExp = "秒=")
    private Long timeUsed;

    /** 0是已删除，1是保留 */
    private Long del;


    
    /** 题库信息 */
    private QuestionBank questionBank;
    
    /** 用户信息 */
    private SysYouYouUser sysYouYouUser;
    
    /** 题目信息 */
    private Question question;


    // 新增：用于接收"昵称查询条件"的字段（非表字段，仅用于查询）
    private String nickName;
    private String title;    // 仅用于查询的题目标题
    private String bankName; // 题库名称（仅用于查询）
  

    // 新增用于存储格式化后时间的字段
    private String timeUsedStr;
    public String getTimeUsedStr() {
        return timeUsedStr;
    }
    public void setTimeUsedStr(String timeUsedStr) {
        this.timeUsedStr = timeUsedStr;
    }


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("totalCount", getTotalCount())
            .append("correctList", getCorrectList())
            .append("wrongList", getWrongList())
            .append("unansweredList", getUnansweredList())
            .append("recordType", getRecordType())
            .append("timeUsed", getTimeUsed())
            .append("timeUsedStr", getTimeUsedStr())
            .append("createTime", getCreateTime())
            .append("del", getDel())
            .append("bankId", getBankId())
            .append("sysYouYouUser", getSysYouYouUser())
            .append("question", getQuestion())
            .toString();
    }
}
